import java.util.ArrayList;
import java.util.List;

public class SolutionTest {
    
    private static List<Integer> list = new ArrayList<>();

    private static int min = Integer.MAX_VALUE;

    public static int countArray(int[][] array,int index,int duration,int splic) {
        if(array == null || array.length < 2) {
            return -1;
        }
        if(index >= array.length) {
            return -1;
        }
        int low  = array[index][0];
        int high = array[index][1];
        for (int i = index; i < array.length; i++) {
            if (low <= array[i][0] && high >= array[i][0]
                    && array[i][1] >= high) {
                list.add(low - high);
                high = array[i][1];
                splic++;
                if(high - low >duration) {
                    min = Math.min(min,splic);
                }
            }
        }
        countArray(array,++index,duration,splic);
        return -1;
    }



    public static void main(String[] args) {
        
    }
}
